package com.dyzx.hbb.modules.wms.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * 盘点明细
 * @TableName wms_stock_takes_details
 */
@TableName(value ="wms_stock_takes_details")
@Data
public class WmsStockTakesDetails {
    /**
     * 编号
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 状态 字典信息：sys_global_status   'Draft', 'Pending', 'Completed', 'Cancelled'
     */
    private Integer status;

     /**
     * 创建日期（毫秒级时间戳）
     */
    @TableField(fill= FieldFill.INSERT)
    private Long createDate;

    /**
     * 更新日期（毫秒级时间戳）
     */
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Long updateDate;

    /**
     * 删除标志
     */
    private Integer deleted;

    /**
     * 操作用户编号
     */
    private Long operatorId;

    /**
     * 企业编号
     */
    private Long organId;

    /**
     * 库存盘点表
     */
    private Long takeId;

    /**
     * 数量
     */
    private Integer countedQuantity;

    /**
     * 实际入库数量（允许部分入库）
     */
    private Integer systemQuantity;

    /**
     * 货位
     */
    private Long locationId;

    /**
     * 货位
     */
    private Long locationAreaId;

    /**
     * 仓库表（管理物理仓库信息）
     */
    private Long houseId;

    /**
     * 商品
     */
    private Long productId;

    /**
     * 库存入口编号
     */
    private Long inventoryId;

    /**
     * 差异:counted_quantity - system_quantity
     */
    private Integer variance;

    /**
     * 差异原因（如：损耗、计数错误等）
     */
    private String reason;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WmsStockTakesDetails other = (WmsStockTakesDetails) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
            && (this.getOrganId() == null ? other.getOrganId() == null : this.getOrganId().equals(other.getOrganId()))
            && (this.getTakeId() == null ? other.getTakeId() == null : this.getTakeId().equals(other.getTakeId()))
            && (this.getCountedQuantity() == null ? other.getCountedQuantity() == null : this.getCountedQuantity().equals(other.getCountedQuantity()))
            && (this.getSystemQuantity() == null ? other.getSystemQuantity() == null : this.getSystemQuantity().equals(other.getSystemQuantity()))
            && (this.getLocationId() == null ? other.getLocationId() == null : this.getLocationId().equals(other.getLocationId()))
            && (this.getLocationAreaId() == null ? other.getLocationAreaId() == null : this.getLocationAreaId().equals(other.getLocationAreaId()))
            && (this.getHouseId() == null ? other.getHouseId() == null : this.getHouseId().equals(other.getHouseId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getInventoryId() == null ? other.getInventoryId() == null : this.getInventoryId().equals(other.getInventoryId()))
            && (this.getVariance() == null ? other.getVariance() == null : this.getVariance().equals(other.getVariance()))
            && (this.getReason() == null ? other.getReason() == null : this.getReason().equals(other.getReason()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
        result = prime * result + ((getOrganId() == null) ? 0 : getOrganId().hashCode());
        result = prime * result + ((getTakeId() == null) ? 0 : getTakeId().hashCode());
        result = prime * result + ((getCountedQuantity() == null) ? 0 : getCountedQuantity().hashCode());
        result = prime * result + ((getSystemQuantity() == null) ? 0 : getSystemQuantity().hashCode());
        result = prime * result + ((getLocationId() == null) ? 0 : getLocationId().hashCode());
        result = prime * result + ((getLocationAreaId() == null) ? 0 : getLocationAreaId().hashCode());
        result = prime * result + ((getHouseId() == null) ? 0 : getHouseId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getInventoryId() == null) ? 0 : getInventoryId().hashCode());
        result = prime * result + ((getVariance() == null) ? 0 : getVariance().hashCode());
        result = prime * result + ((getReason() == null) ? 0 : getReason().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", status=").append(status);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", deleted=").append(deleted);
        sb.append(", operatorId=").append(operatorId);
        sb.append(", organId=").append(organId);
        sb.append(", takeId=").append(takeId);
        sb.append(", countedQuantity=").append(countedQuantity);
        sb.append(", systemQuantity=").append(systemQuantity);
        sb.append(", locationId=").append(locationId);
        sb.append(", locationAreaId=").append(locationAreaId);
        sb.append(", houseId=").append(houseId);
        sb.append(", productId=").append(productId);
        sb.append(", inventoryId=").append(inventoryId);
        sb.append(", variance=").append(variance);
        sb.append(", reason=").append(reason);
        sb.append("]");
        return sb.toString();
    }
}